/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// IUserCardCost interface for NHibernate mapped table 'UserCardCost'.
	/// </summary>
	public interface IUserCardCost
	{
		#region Public Properties
		
		int c_id
		{
			get ;
			set ;
			  
		}
		
		int c_uid
		{
			get ;
			set ;
			  
		}
		
		int c_ucid
		{
			get ;
			set ;
			  
		}
		
		int c_times
		{
			get ;
			set ;
			  
		}
		
		DateTime c_startTime
		{
			get ;
			set ;
			  
		}
		
		DateTime c_endTime
		{
			get ;
			set ;
			  
		}
		
		int c_user
		{
			get ;
			set ;
			  
		}
		
		DateTime c_addTime
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// UserCardCost object for NHibernate mapped table 'UserCardCost'.
	/// </summary>
	[Serializable]
	public class UserCardCost : ICloneable,IUserCardCost
	{
		#region Member Variables

		protected int _c_id;
		protected int _c_uid;
		protected int _c_ucid;
		protected int _c_times;
		protected DateTime _c_starttime;
		protected DateTime _c_endtime;
		protected int _c_user;
		protected DateTime _c_addtime;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public UserCardCost() {}
		
		public UserCardCost(int pcuid, int pcucid, int pctimes, DateTime pcstartTime, DateTime pcendTime, int pcuser, DateTime pcaddTime)
		{
			this._c_uid = pcuid; 
			this._c_ucid = pcucid; 
			this._c_times = pctimes; 
			this._c_starttime = pcstartTime; 
			this._c_endtime = pcendTime; 
			this._c_user = pcuser; 
			this._c_addtime = pcaddTime; 
		}
		
		public UserCardCost(int pcid)
		{
			this._c_id = pcid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int c_id
		{
			get { return _c_id; }
			set { _bIsChanged |= (_c_id != value); _c_id = value; }
			
		}
		
		public virtual int c_uid
		{
			get { return _c_uid; }
			set { _bIsChanged |= (_c_uid != value); _c_uid = value; }
			
		}
		
		public virtual int c_ucid
		{
			get { return _c_ucid; }
			set { _bIsChanged |= (_c_ucid != value); _c_ucid = value; }
			
		}
		
		public virtual int c_times
		{
			get { return _c_times; }
			set { _bIsChanged |= (_c_times != value); _c_times = value; }
			
		}
		
		public virtual DateTime c_startTime
		{
			get { return _c_starttime; }
			set { _bIsChanged |= (_c_starttime != value); _c_starttime = value; }
			
		}
		
		public virtual DateTime c_endTime
		{
			get { return _c_endtime; }
			set { _bIsChanged |= (_c_endtime != value); _c_endtime = value; }
			
		}
		
		public virtual int c_user
		{
			get { return _c_user; }
			set { _bIsChanged |= (_c_user != value); _c_user = value; }
			
		}
		
		public virtual DateTime c_addTime
		{
			get { return _c_addtime; }
			set { _bIsChanged |= (_c_addtime != value); _c_addtime = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			UserCardCost castObj = null;
			try
			{
				castObj = (UserCardCost)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._c_id == castObj.c_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _c_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for UserCardCost 

	
	public interface IUserCardCostCollection : ICollection
	{
		UserCardCost this[int index]{	get; set; }
		void Add(UserCardCost pUserCardCost);
		void Clear();
	}
	
	[Serializable]
	public class UserCardCostCollection : IUserCardCostCollection
	{
		private IList<UserCardCost> _arrayInternal;

		public UserCardCostCollection()
		{
			_arrayInternal = new List<UserCardCost>();
		}
		
		public UserCardCostCollection( IList<UserCardCost> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<UserCardCost>();
			}
		}

		public UserCardCost this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((UserCardCost[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(UserCardCost pUserCardCost) { _arrayInternal.Add(pUserCardCost); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<UserCardCost> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
